#ifndef ENBODY_H
#define ENBODY_H

#include <QPoint>
#include <QImage>
#include <QGraphicsItem>
#include <QPen>
#include <QBrush>
#include <string>

/* drawable object with synchonization */
class EnBody : public QObject
{
    Q_OBJECT

public:
    static void parseOscMsg( const char* argument, int newValue, EnBody *body );
    static int localObjectCounter;

    EnBody( QString key );
    ~EnBody();
    QBrush getBrush();
    QGraphicsEllipseItem* getGraphicsItem();
    void updatePos( const QPointF& point );
    void updateColor( const QColor& color );
    QString getMapKey();

signals:
    void posChanged( QString bodyMapKey, const QPointF& point );
    void colorChanged( QString bodyMapKey, const QColor& color );

private:
    static QColor colorCache;
    QGraphicsEllipseItem* graphicsItem;
    QPen pen;
    QBrush brush;
    QColor fillColor,outlineColor;
    QString mapKey;

};

#endif // ENBODY_H
